<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>模块管理</title>
    <script type="text/javascript" src="/resource/easyui/jquery.min.js"></script>
    <script type="text/javascript" src="/resource/easyui/jquery.easyui.min.js"></script>

    <link rel="stylesheet" href="/resource/easyui/themes/default/easyui.css">
    <link rel="stylesheet" href="/resource/easyui/themes/icon.css">
    <script type="text/javascript">

        $(function () {
            initDg();

        });

        function initDg() {
            $('#dg').datagrid({
                url:'/module/moduleJson.do',
                toolbar:'#toolbar',
                columns:[[
                    {field:'id',title:'ID',width:100},
                    {field:'name',title:'名称',width:100},
                    {field:'type',title:'类型',width:100,formatter: function (value, row, index) {
                        if (value == 1){
                            return '人物模式';
                        }else if (value == 0 ) {
                            return "普通模式";
                        }
                    }},
                    {field:'edit',title:'编辑',width:100,align:'right',formatter: function (value, row, index) {
                        return "<a href='/admin/module/editModuleUi.do?id="+row.id+"' class=\"btn-edit\" data-options=\"iconCls:'icon-edit'\"  onclick='editModule()'>编辑</a>"
                    }},
                    {field:'clean',title:'清空文章',width:100,align:'right',formatter: function (value, row, index) {
                        return "<a href='/admin/module/cleanModule.do?id="+row.id+"' class=\"btn-clean\" data-options=\"iconCls:'icon-clean'\"  onclick='cleanModule()' >清空</a>"
                    }},
                    {field:'remove',title:'删除',width:100,align:'right',formatter: function (value, row, index) {
                        return "<a href='/admin/module/removeModule.do?id="+row.id+"' class=\"btn-remove\" data-options=\"iconCls:'icon-remove'\"  onclick='removeModule()'>删除</a>"
                    }}
                ]]
            });
        }
    </script>
</head>
<body>
    <!--模块表格-->
    <table id="dg" style="width: 100%;"></table>

    <div id="toolbar">
        <a class="easyui-linkbutton" iconCls="icon-add" onclick="createModule()">创建新模块</a>
    </div>
</body>
</html>